* This do-file runs the regressions that replicate and extend part of Mutz (2018)

* Log file	

log using "replication_mutz_logfile.log", replace

* Import data from Mutz (2018). This data is contained in the replication package by Mutz(2018) and is labeled as "Amerispeak2016OctForReplication.dta".

* It can be downloaded from https://www.asc.upenn.edu/research/centers/institute-for-the-study-of-citizens-and-politics/publications/supplemental-materials

* Here, we rename it as replication_mutz_2018 and include only the variables that are need from the analysis



* Let's import the data

use  "./replication_mutz_2018.dta", replace

* Data preparation like in Mutz (2018)
		
egen cutdifftherm= cut(thermdiffTC), group(20)

* First define the regression sample from regression with longer equation

regress cutdifftherm party3 noncollegegrad  white GENDER i.AGE7 religion INCOME lookwork  perecoperc  medianincome  ecoperc immigin, robust  

cap drop in_broken

gen in_broken=e(sample)

*** Main specification: pocketbook evaluation as in column 5 of Table 1 and column 1 of Table B.1, keeping the sample constant

regress cutdifftherm party3 noncollegegrad  white GENDER i.AGE7 religion INCOME lookwork  perecoperc  medianincome  ecoperc if in_broken, robust  


*** Regression controlling for immigration stances, as in column 6 of Table 1 and column 2 of Table B.1

regress cutdifftherm party3 noncollegegrad  white GENDER i.AGE7 religion INCOME lookwork  perecoperc  medianincome  ecoperc immigin, robust  


*** Regression of immigration stances on pocketbook evaluation, as in column 4 of Table 2 and column 3 of Table B.1

regress immigin party3 noncollegegrad  white GENDER i.AGE7 religion INCOME lookwork  perecoperc  medianincome  ecoperc if in_broken, robust  



* close log file

log close